<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>购物车</title>
	<link rel="stylesheet/less" href="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/css/base.less" />
	<link rel="stylesheet/less" href="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/css/shop_cart.less" />
	<script type="text/javascript">
		var APP = '<?php echo "http://localhost/Project/Meituan/index.php/Index" ;?>';
	</script>
	<script type="text/javascript" src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/js/jquery-1.11.0.min.js"></script>
	<script type="text/javascript" src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/js/head.js"></script>
	<script type="text/javascript" src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/js/menu.js"></script>
	<script type="text/javascript" src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/js/common.js"></script>
	<script type="text/javascript" src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/js/cart1.js"></script>
	<!-- 为了保证IE载入以下文件 -->
	<script type="text/javascript" src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/Css/es5-shim/es5-sham.min.js"></script>
	<script type="text/javascript" src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/Css/es5-shim/es5-shim.min.js"></script>
	<!-- 载入less.js -->
	<script type="text/javascript" src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/Css/es5-shim/less-1.5.0.min.js"></script>
	
</head>
<body>
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?>	<!-- 头部开始 -->
	<div id="top">
		<div id="top-con2">
			<div class="top-left">
				<div class="top-left1">
					<?php if(isset($_SESSION['username'])){?>
						<span class="userinfo">hi,<a href="<?php echo U('Member/order');?>" class="username"><?php echo $_SESSION['username'];?></a> <a href="<?php echo U('Login/quit');?>" class="quit">退出</a></span>
						<?php  }else{ ?>
						<span>美团一次 美一次</span>
						<span><a class="red" href="<?php echo U('Login/index');?>">登陆</a></span>
						<span><a href="<?php echo U('Regist/index');?>">注册</a></span>
						<!-- <span>|</span> -->
					<?php }?>
				</div>
			</div>
			<div class="top-right" >
				<ul>
					<li class="top-right-li"><p class="top-right-p"><a href="<?php echo U('Member/order');?>">我的订单</a></p></li>
					<li class="top-right-li have-son">
						<p class="top-right-p"><a class="top-right-menu" href="<?php echo U('Member/order');?>">我的美团</a><i class="sj"></i><i class="shu"></i></p>
						
						<div class="top-right-son mymt-pos">
							<ul class="mymt">
								<li><a href="<?php echo U('Member/order');?>">我的订单</a></li>
								<li><a href="<?php echo U('Member/collect');?>">我的收藏</a></li>
								<li><a href="<?php echo U('Member/basicInfo');?>">基本信息</a></li>
								<li><a href="<?php echo U('Member/userinfo');?>">个人资料</a></li>
								<li><a href="<?php echo U('Member/address');?>">收货地址</a></li>
							</ul>
						</div>
						
					</li>
					<li class="top-right-li have-son">
						<p class="top-right-p"><a class="top-right-menu" href="">最近浏览</a><i class="sj"></i><i class="shu"></i></p>
						
						<div class="top-right-son viewed-pos">
							<?php if(is_null($_SESSION['viewed'])){?>
							<p class="wu">暂无浏览记录</p>
							<?php  }else{ ?>
							<ul class="viewed">
								<?php if(is_array($_SESSION['viewed'])):?><?php  foreach($_SESSION['viewed'] as $k=>$v){ ?>
								<li>
									<div class="tu"><a href="<?php echo U('Article/index',array('gid'=>$v['gid']));?>" target="_blank"><img src="http://localhost/Project/Meituan/<?php echo $v['pic'];?>" width="80" height="49" /></a></div>
									<div class="info">
										<p><a href="<?php echo U('Article/index',array('gid'=>$v['gid']));?>" target="_blank"><?php echo $v['title'];?></a></p>
										<p class="p2"><span>￥<?php echo $v['group_price'];?></span><del><?php echo $v['price'];?></del></p>
									</div>
								</li>
							<?php }?><?php endif;?>
							</ul>
							<p class="unset-viewed"><a  href="javascript:" class="del_viewed" style="color:#2bb8aa">清空最近浏览记录</a></p>
							<?php }?>
						</div>
						</li>
						<!-- 商品购物车开始 -->
					<li class="top-right-li have-son">
						<p class="top-right-p gwche"><i class="che"></i><a class="top-right-menu" href="">购物车<span class="gwche-num"><?php echo count($cart);?></span>件</a><i class="sj"></i><i class="shu"></i></p>
					
						<div class="top-right-son gwche-pos" id="cart">
							<?php if(is_null($cart)){?>
							<p class="wu">暂没有加入购物车的商品</p>
							<?php  }else{ ?>
							<ul class="viewed">
								<?php if(is_array($cart)):?><?php  foreach($cart as $v){ ?>
								<li class="top_cartlist">
									<div class="tu"><a href="<?php echo U('Article/index',array('gid'=>$v['gid']));?>"><img src="http://localhost/Project/Meituan/<?php echo $v['pic'];?>" width="80" height="49" /></a></div>
									<div class="info">
										<p><a href="<?php echo U('Article/index',array('gid'=>$v['gid']));?>"><?php echo $v['title'];?></a></p>
										<p class="p2"><span>￥<?php echo $v['group_price'];?></span><a class="del top_del_cart" href="javascript:" gid="<?php echo $v['gid'];?>">删除</a></p>
									</div>
								</li>
							<?php }?><?php endif;?>
							</ul>

							<p class="go-gwche"><a href="<?php echo U('Cart/cart1');?>">查看我的购物车</a></p>
							<?php }?>
						</div>
		
						</li>
						<!-- 商品购物车结束 -->
				<!-- 	<li class="top-right-li have-son">
				<p class="top-right-p"><a class="top-right-menu" href="">联系客服</a><i class="sj"></i><i class="shu"></i></p>
				<div class="top-right-son contact-pos">
						<ul class="mymt">
							<li><a href="">申请退款</a></li>
							<li><a href="">申请退换货</a></li>
							<li><a href="">常见问题</a></li>
						</ul>
					</div>
				</li> -->
				</ul>
			</div>
			<div class="clear"></div>
		</div>
	</div>
<!-- 头部结束 -->
<!-- logo 和 搜索开始 -->
	<div id="logo-sch-bao2">
		<div class="logo-piece logo-piece-w240">
			<a href="http://localhost/Project/Meituan" id="logo"></a>
			<span class="city">北京</span>
			<a class="choose-city" href="">切换城市</a>
		</div>
		<div class="sch-piece sch-piece-w">
			<div class="sch">
				<div class="form">
				<form name="sch_form" action="<?php echo U('Search/index');?>" method="post">
					<div class="sch-left sch-left-w">
						<span class="sj"></span>
						<ul class="tuan-shang">
							<li>团购</li>
							<!-- <li>商家</li> -->
						</ul>
						<input class="search search-w" type="text" name="search" placeholder="请输入商品名称" />
					</div>
					<input class="btn" name="sch-btn" type="submit" value="搜 索" />
					</form>
				</div>
			</div>
			<div class="clear"></div>
			<!-- <div class="hot-words">
				<a href="">自助餐</a>
				<a href="">自助餐</a>
				<a href="">自助餐</a>
				<a href="">自助餐</a>
				<a href="">自助餐</a>
			</div> -->
		</div>
		<div class="bao"></div>
		<div class="clear"></div>
	</div>
<!-- logo 和 搜素结束 -->

<!-- 菜单部分开始 -->
<div id="menu">
	<div class="menu-l">
		<p class="cate-top">全部分类<i></i></p>
		<div class="cate-son-con">
			
			<?php if(is_array($allCate)):?><?php  foreach($allCate as $k=>$v){ ?>
			<div class="cate-list">
				<div class="cate-left-con">
					<h3 class="top-cate"><a href="<?php echo U('List/index',array('cid'=>$k));?>"><?php echo $v['parent'];?></a></h3>
					<p class="son-cate">
						<?php 
							if($v['parent'] == '酒店' || $v['parent'] == '电影'){
								$son = array_slice($v['son'], 0,2,true); 
							}else{
								$son = array_slice($v['son'], 0,3,true); 
							}
						?>
						<?php if(is_array($son)):?><?php  foreach($son as $key=>$value){ ?>
						<a href="<?php echo U('List/index',array('cid'=>$key));?>"><?php echo $value;?></a>
						<?php }?><?php endif;?>
					</p>
					<i class="right-arrow"></i>
				</div>
				<div class="cate-xian"></div>
				<div class="cate-right-con">
					<h3 class="right-top-cate"><a href=""><?php echo $v['parent'];?></a></h3>
					<p class="right-cate-son">
						<?php if(is_array($v['son'])):?><?php  foreach($v['son'] as $key=>$v){ ?>
						<a href="<?php echo U('List/index',array('cid'=>$key));?>"><?php echo $v;?></a>
						<?php }?><?php endif;?>
					</p>
				</div>
			</div>
			<?php }?><?php endif;?>

		</div>
	</div>
	<div class="menu-r">
		<ul>
			<li><a href="http://localhost/Project/Meituan">首页</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>1));?>">美食</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>2));?>">酒店</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>3));?>">电影</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>4));?>">休闲娱乐</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>5));?>">旅游</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>6));?>">生活服务</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>8));?>">丽人</a></li>
		</ul>
	</div>
	<div class="clear"></div>
</div>
<!-- 菜单部分结束 -->
<!-- 主体部分开始 -->
<p class="zhishao">最少 1 件起售</p>
<div class="shop-cart-con">
	<div class="che-l">
		<i></i>
		<div class="che-l-r">
			<h3>我的购物车</h3>
			<div class="percent">
				<span class="bg"><span class="up" style="width:<?php echo $per;?>%"></span></span>
				<span class="num" style="margin-left:10px;"><?php echo count($cart);?>/20</span>
			</div>
		</div>
		
	</div>
	<div class="che-r"><img src="http://localhost/Project/Meituan/./Mei/Mei/Index/Tpl/Public/images/step1.jpg" alt="" /></div>
	<div class="clear"></div>
	<!-- 如果购物车是空的显示块开始 -->
<?php if(is_null($cart) or empty($cart)){?>
<div class="shop-nothing">
	<i></i>
	<p><strong>您的购物车还是空的，赶紧行动吧！您可以：</strong><br />去<a href="http://localhost/Project/Meituan">首页</a>团购喜欢的产品</p>
</div>

<!-- 如果购物车是空的显示块结束-->
<?php  }else{ ?>
<!-- 如果购物车有商品 开始 -->
<form action="<?php echo U('Cart/cart2');?>" method="post">
<table border="0" width="100%" cellspacing="0" class="shop-list">
	<tr bgcolor="#f7f7f7" style="font-size:14px; border-bottom:1px solid #ddd; height:40px;">
		<th width="100"><input type="checkbox" name="all" checked="checked" /> <label for="all">全选</label></th>
		<th width="300">项目</th>
		<th width="120" align="center">状态</th>
		<th width="120" align="center">单价</th>
		<th width="170" align="center">类型/数量</th>
		<th width="" align="center">小计</th>
	</tr>
	<?php if(is_array($cart)):?><?php  foreach($cart as $v){ ?>
	<tr height="60" class="listtr">
		<td align="center"><input type="checkbox" name="gid[]" checked="checked" value="<?php echo $v['gid'];?>" /></td>
		<td>
			<div class="item">
				<div class="tu"><a href="<?php echo U('Article/index',array('gid'=>$v['gid']));?>" target="_blank"><img src="http://localhost/Project/Meituan/<?php echo $v['pic'];?>" width="75" height="45" alt="" /></a></div>
				<div class="info"><p><a href="<?php echo U('Article/index',array('gid'=>$v['gid']));?>" target="_blank"><?php echo $v['title'];?></a></p></div><input type="hidden" name="title_<?php echo $v['gid'];?>" value="<?php echo $v['title'];?>" />
			</div>
		</td>
		<td align="center">可购买</td>
		<td align="center">¥<span class="group_price"><?php echo $v['group_price'];?></span><input type="hidden" name="group_price_<?php echo $v['gid'];?>" value="<?php echo $v['group_price'];?>" /></td>
		<td><p class="num"><a class="subtract" href="javascript:">－</a><input class="num-text" type="text" value="<?php echo $v['num'];?>" name="num_<?php echo $v['gid'];?>" /><a class="plus" href="javascript:">＋</a></p>
		</td>
		<td align="center" class="xiaoji">¥<span>37.10</span></td>
	</tr>
	<?php }?><?php endif;?>
	<tr height="50">
		<td colspan="6">
			<div class="total">已选<span class="jian"><?php echo count($cart);?></span>件商品 应付总额： <span class="zong">¥37.10</span> </div>
		</td>
	</tr>
</table>
<div class="sub-order"><input type="submit" value="提交订单" /></div>
</form>
<?php }?>
<!-- 如果购物车有东西 结束 -->
</div>


<!-- 主体部分结束 -->
<!-- 底部开始 -->
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><div id="footer">
	<div id="footer-con">
		<div class="foot-info">
			<h3>获取更新</h3>
			<ul>
				<li><a href="">邮件订阅</a></li>
				<li><a href="">iPhone/Android</a></li>
				<li><a href="">美团QQ空间</a></li>
				<li><a href="">美团新浪微博</a></li>
				<li><a href="">sitemap</a></li>
				<li><a href="">RSS订阅</a></li>
			</ul>	
		</div>
		<div class="foot-info">
			<h3>商务合作</h3>
			<ul>
				<li><a href="">提供团购信息</a></li>
				<li><a href="">美团商家营销平台</a></li>
				<li><a href="">市场合作</a></li>
				<li><a href="">美团联盟</a></li>
				<li><a href="">廉正邮箱</a></li>
			</ul>	
		</div>
		<div class="foot-info">
			<h3>公司信息</h3>
			<ul>
				<li><a href="">邮件订阅</a></li>
				<li><a href="">美团承诺</a></li>
				<li><a href="">加入我们</a></li>
				<li><a href="">法律声明</a></li>
				<li><a href="">用户协议</a></li>
			</ul>	
		</div>
		<div class="foot-info">
			<h3>用户帮助</h3>
			<ul>
				<li><a href="">申请退款</a></li>
				<li><a href="">查看美团券密码</a></li>
				<li><a href="">常见问题</a></li>
				<li><a href="">开放API</a></li>
				<li><a href="">美团云</a></li>
				<li><a href="">反诈骗公告</a></li>
			</ul>	
		</div>
		<div class="foot-info">
			<h3>获取更新</h3>
			<ul>
				<li><a href="">邮件订阅</a></li>
				<li><a href="">iPhone/Android</a></li>
				<li><a href="">美团QQ空间</a></li>
				<li><a href="">美团新浪微博</a></li>
				<li><a href="">sitemap</a></li>
				<li><a href="">RSS订阅</a></li>
			</ul>	
		</div>
		<div class="foot-info">
			<span class="tou"></span>	
			<p class="p1"><strong>退款、退换货、查看美团券</strong><br /><a href="">参考教程，轻松搞定 »</a></p>
			<p class="p2">
客服电话：400-660-5335 <br />
服务时间：每天 9:00 - 22:00</p>
		</div>
		<div class="clear"></div>
		<p class="power">©2014美团网团购 meituan.com 京ICP证070791号 京公网安备11010502025545号 电子公告服务规则</p>
	<div class="zheng">
		<a class="a1" href=""></a>
		<a class="a2" href=""></a>
		<a class="a3" href=""></a>
		<a class="a4" href=""></a>
		<a class="a5" href=""></a>
		<a class="a6" href=""></a>

	</div>
	</div>
	
</div>
<!-- 底部结束 -->
</body>
</html>